﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Manager.master" AutoEventWireup="true" CodeFile="BannerManager.aspx.cs" Inherits="BannerManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<%--<link href="<%= ResolveUrl("~/Styles/themes/base/ui.all.css")%>" rel="stylesheet" type="text/css" />--%>
    <script src="<%= ResolveUrl("~/Scripts/ui.core.js")%>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Scripts/ui.accordion.js")%>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/Scripts/ui.datepicker.js")%>" type="text/javascript"></script>
 <script type="text/javascript">
     function changeName(ele) {
         if (ele.value != "") {
             document.getElementById("<%=txtfileUpload.ClientID %>").value = ele.value;
         }
     }
     jQuery(function () {
         jQuery("#<%= txtStartShow.ClientID %>").datepicker({ minDate: -15, maxDate: '15D' });
         jQuery("#Addbanner").click(function () {
             jQuery("#AddBannerForm").toggle("normal");
         });
     });
    </script>
    <%--<link href="<%= ResolveUrl("~/Styles/uploader.css")%>" rel="stylesheet" type="text/css" />--%>
    <div style="margin:0 auto">
        <div class="content_area1">
            <h1>Quản lý Banner</h1>
            <div style="padding-left:10px;">
                <div style="margin:0 20px; position:relative;">
                    <div>
                        <h3>Danh sách banner</h3>
                    </div>
                    <div style="position:absolute; right:0; top:-5px;">
                        <a href="javascript:void(0);" id="Addbanner">
                            <img src="<%= ResolveUrl("~/images/Admin/icon_add.gif")%>" alt="Thêm mới" />
                            Đăng kí banner
                        </a>
                    </div>
                </div>
                <div style="margin:10px 20px 0;">
                    <asp:Repeater ID="rptBanner" runat="server">
                        <HeaderTemplate>
                            <table id="bannerList">
                                <tr>
                                    <th style="width:3%">STT</th>
                                    <th style="width:10%">Banner</th>
                                    <th style="width:6%">Ngày đăng kí</th>
                                    <th style="width:6%">Ngày hết hạn</th>
                                    <th style="width:6%">Trạng thái</th>
                                    <th style="width:4%">Thao tác</th>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                                <tr>
                                    <td><%# Container.ItemIndex+1 %></td>
                                    <td><img src='<%= ResolveUrl("~/images/banners/") %><%#DataBinder.Eval(Container.DataItem, "UsersAdv_PicturePath") %>' alt='' /></td>
                                    <td><%# (DataBinder.Eval(Container.DataItem, "UsersAdv_FromDate")!=null)? showDateTime(Eval("UsersAdv_FromDate").ToString()): ""%></td>
                                    <td><%# (DataBinder.Eval(Container.DataItem, "UsersAdv_ToDate") != null) ? showDateTime(Eval("UsersAdv_ToDate").ToString()) : ""%></td>
                                    <td><%# (DataBinder.Eval(Container.DataItem, "UsersAdv_Status") != null) ? activeAdv(Eval("UsersAdv_Status").ToString()) : ""%></td>
                                    <td>
                                        <asp:ImageButton ID="btnedit" runat="server" style="width:15px; height:15px" ImageUrl="~/images/Admin/icon_edit.gif" CommandName="edit"
                                 CommandArgument='<%#DataBinder.Eval(Container.DataItem, "UsersAdv_Id") %>' />&nbsp;
                                <asp:ImageButton ID="btndelete" runat="server" ImageUrl="~/images/Admin/icon_delete.gif.png" CommandName="delete" 
                                CommandArgument='<%#DataBinder.Eval(Container.DataItem, "UsersAdv_Id") %>' OnClientClick="return confirm('Bạn có chắc muốn xóa không ?');" />
                                    </td>
                                </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
                <div style="margin:0 20px; display:none" id="AddBannerForm">
                    <asp:Panel ID="panelAdv" runat="server">
                        <table>
                            <tr>
                                <td colspan="2">
                                    <div style="clear:both; padding-top:5px;">
                                        <label>Chọn banner để upload</label>
                                        <div class="inputcontainer">
                                            <div class="upload-file-L-Style2" id="UploadButton">
                                                <div class="upload-file-R-Style2">
                                                    <input type="button" id="btnCartBtnMidText2" class="buttonDefault form-submit" style="cursor:pointer;" value="Chọn file" />
                                                </div>
                                            </div>        
                                            <a>
                                                <asp:FileUpload ID="strFileUpload" runat="server" class="fileNamelblSelect upload-file-styele2" style="cursor:pointer; border:1px solid #c00000;"
                                                    onchange="javascript:changeName(this);" size="1" />
                                            </a>
                                            <div style="color:Black;vertical-align:middle" class="upload-text-box">
                                                <asp:TextBox ID="txtfileUpload" Enabled="false" ReadOnly="true" runat="server" style="margin:2px 0 2px 3px;border:none;border-color: transparent; padding-top:3px; width:450px; background-color:#f5f5f5"></asp:TextBox>
                                            </div>
                                        </div>
                                        <br class="clear" />
                                        <div style="text-align:center">
                                            <asp:Label ID="lblsizebanner" runat="server"></asp:Label>&nbsp;
                                            (Vui lòng chỉnh sửa kích thước hình trước khi upload)
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>Vị trí</td>
                                <td>
                                    <asp:DropDownList ID="ddlBannerPosition" runat="server">
                                        <asp:ListItem Text="Top" Value="top"></asp:ListItem>
                                        <asp:ListItem Text="Center" Value="center"></asp:ListItem>
                                        <asp:ListItem Text="Footer" Value="footer"></asp:ListItem>
                                        <asp:ListItem Text="Right" Value="right"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Gói điểm</td>
                                <td>
                                    <asp:DropDownList ID="ddlPointPackage" runat="server"></asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Ngày bắt đầu</td>
                                <td><asp:TextBox ID="txtStartShow" runat="server" ReadOnly="true"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="btnRegis_Adv" runat="server" Text="Đăng kí" 
                                        onclick="btnRegis_Adv_Click" CssClass="buttonDefault form-submit" />
                                    <asp:Button ID="btnCancel_adv" runat="server" Text="Hủy" 
                                        onclick="btnCancel_adv_Click" CssClass="buttonDefault form-submit" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
            </div>
        </div>
        <br class="clear" />
        <img src="<%= ResolveUrl("~/images/bottom.jpg")%>" align="absbottom" alt="" />
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>

